﻿using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;

using Finance.Entites;
using Finance.Service.Interfaces;

namespace Finance.Service.Implements
{
    /// <summary>
    /// Store the data with json format in the disk
    /// </summary>
    /// <typeparam name="TEntity">The graph of store object contains in ObserableCollection</typeparam>
    public class MockTraderDataStore : JsonDataStore<Finance.Entites.Trader>
    {
        private static ObservableCollection<Trader> _TraderCollections = new ObservableCollection<Trader>();

        public override ObservableCollection<Trader> Items
        {
            get
            {
                if (base._Items == null || base._Items.Count == 0)
                {
                    _TraderCollections.Clear();

                    _TraderCollections.Add(new Trader() { Name = "暂无商家", });
                    _TraderCollections.Add(new Trader() { Name = "金融机构", });
                    _TraderCollections.Add(new Trader() { Name = "餐厅饭堂", });
                    _TraderCollections.Add(new Trader() { Name = "超市商铺", });
                    _TraderCollections.Add(new Trader() { Name = "公共机构", });
                    _TraderCollections.Add(new Trader() { Name = "其他商家", });

                    base._Items = _TraderCollections;
                    base.Commit();
                }
                return base._Items;
            }
        }
    }
}
